﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.XtraEditors;
namespace SchoolManagementSystem.Controls
{
   public class MessageControl
    {
       public enum Icon
       {
           Error,
           Warning,
           Success,
           Info
       }
        public static void ShowMessage(string Mess,string title,Icon icon)
        {
            System.Windows.Forms.MessageBoxIcon i = System.Windows.Forms.MessageBoxIcon.None;
            if(icon==Icon.Error)
            {
                i = System.Windows.Forms.MessageBoxIcon.Error;
            }
            if(icon == Icon.Warning)
            {
                i = System.Windows.Forms.MessageBoxIcon.Warning;
            }
            if (icon == Icon.Success)
            {
                i = System.Windows.Forms.MessageBoxIcon.Information;
            }
            if (icon == Icon.Info)
            {
                i = System.Windows.Forms.MessageBoxIcon.Information;
            }
            XtraMessageBox.Show(Mess, title, System.Windows.Forms.MessageBoxButtons.OK, i);
        }


        public static System.Windows.Forms.DialogResult ShowMessageWithResult(string Mess, string title, Icon icon)
        {
            System.Windows.Forms.MessageBoxIcon i = System.Windows.Forms.MessageBoxIcon.None;
            if (icon == Icon.Error)
            {
                i = System.Windows.Forms.MessageBoxIcon.Error;
            }
            if (icon == Icon.Warning)
            {
                i = System.Windows.Forms.MessageBoxIcon.Warning;
            }
           return XtraMessageBox.Show(Mess, title, System.Windows.Forms.MessageBoxButtons.OKCancel, i);
        }
    }
}
